<%@ page language="java" isELIgnored="false"%>
<%@include file="../common/taglib.jsp"%>

<div id="Conteudo">
	<html:form action="empresa">
		<html:hidden property="codigo"></html:hidden>
		<html:hidden property="method"></html:hidden>
		<html:hidden property="state"></html:hidden>
		<h1><bean:message key="empresa.label.title"/>:<span><bean:message key="subtitulo.label.cadastro"/></span> </h1>
		<div class="campo">
			<label>
				<bean:message key="empresa.label.nome"/><span>*</span>
			</label> 
			<html:text property="nome" style="width:500px;" maxlength="100"></html:text>
		</div>
		<div class="campo">
			<label>
				<bean:message key="empresa.label.telefone"/><span>*</span>
			</label> 
			<html:text property="telefone" style="width:500px;" maxlength="100"></html:text>
		</div>		
	</html:form>
	
	<%-- <facility-tags:error/>	--%>
	
</div>
<script>
	
	function cancelar(){
		
		document.EmpresaForm.method.value = 'prepareSearch';
		document.EmpresaForm.submit();		
	}
	
	function salvar(){
		
		var estado = document.EmpresaForm.state.value;
		
		if (estado == 'insert'){
			document.EmpresaForm.method.value = 'insert';
		}
		else if (estado == 'update'){
			document.EmpresaForm.method.value = 'update';
		}
				
		document.EmpresaForm.submit();		
	}
	
</script>